﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;

/// <summary>
/// Summary description for WebService
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
// [System.Web.Script.Services.ScriptService]
public class WebService : System.Web.Services.WebService {

    public WebService () {

        //Uncomment the following line if using designed components 
        //InitializeComponent(); 
    }

    [WebMethod]
    public Info GetInfo(String kenteken) {
        Info info = new Info();
        info.kenteken = kenteken;
        info.statusInfoAanvraag = "OK";
        Model model = new Model();
        if (kenteken.Equals("JG-PV-81"))
        {
            info.bsn = 123456789;
            info.chassisNummer = "ABC-123";
            info.kleur = "blauw";
            model.merkNaam = "BMW";
            model.motorInhoud = 1234.00F;
            model.typeAanduiding = "M3";
            model.typeMotor = "B";
            info.model = model;
        }
        else if (kenteken.Equals("PL-XS-12"))
        {
            info.bsn = 987654321;
            info.chassisNummer = "DEF-321";
            info.kleur = "rood";
            model.merkNaam = "Audi";
            model.motorInhoud = 6000.00F;
            model.typeAanduiding = "R8";
            model.typeMotor = "L";
            info.model = model;
        }
        else if (kenteken.Equals("ET-MA-75"))
        {
            info.bsn = 123443212;
            info.chassisNummer = "ERT-678";
            info.kleur = "groen";
            model.merkNaam = "Volkswagen";
            model.motorInhoud = 3500.00F;
            model.typeAanduiding = "Golf";
            model.typeMotor = "D";
            info.model = model;
        }
        else{
            info.statusInfoAanvraag = "NOT FOUND";
        }
        return info;
    }
    
}
